﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MaterPage/Site.Master" AutoEventWireup="true" CodeBehind="ParentPage.aspx.cs" Inherits="Js_Study.Pages.IframeDialog.ParentPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .loading_image {
            background-image: url('/Resource/Images/Loading.gif');
            display: block;
            background-repeat: no-repeat;
            margin-left: 47%;
            margin-top: 29%;
        }
    </style>
    <script type="text/javascript" src="/Resource/Third-Js/jquery-framedialog.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <input type="button" id="btn_show" value="Iframe Dialog" />

    <input type="button" id="btn_test" value="Return Value" />

    <script type="text/javascript">
        var fid = null;
        var ret = "";
        $("#btn_show").click(function () {
            fid = $.FrameDialog
                .create({ url: "ChildPage.aspx?id=1", width: 630, height: 480, title: 'Test return Value!', loadingClass: 'loading_image' })
                .bind("dialogclose", function (e) {
                    ret = e.result;
                })
        });


        $("#btn_test").click(function () {
            alert(ret);
        });
    </script>
</asp:Content>
